home *** CD-ROM | disk | FTP | other *** search
/ Rat Attack (UK) (Digital Press Kit - Summer '99) / Rat Attack (UK) (Digital Press Kit - Summer '99).bin / RAT01.DIR / 00012_Script_UI Pointer Change < prev    next >
Text File  |  1999-04-26  |  4KB  |  99 lines

  1. -- Pointer Change
  2.  
  3.  
  4. -- Changes the stage cursor for the movie, add to any sprite on stage.
  5. -- handles ChangeCursor and RestoreCursor messages
  6.  
  7. property  pointerStyle,  CustomImage, CustomMask, currentPointer
  8. property  Rpointerstyle, RCustomImage, RCustomMask
  9.  
  10. property useCustom, useCustomR -- boolean, tru if use custom cursor art for cursor and/or restored cursor
  11.  
  12. property changeBegin, changeEnd
  13.  
  14. on beginSprite me
  15.   if changeBegin then
  16.     changecursor me  
  17.   end if
  18.   
  19. end
  20.  
  21. on EndSprite me  
  22.   if changeEnd then
  23.     restorecursor me  
  24.   end if
  25. end
  26.  
  27. on ChangeCursor me
  28.   set currentPointer = translate_cursor( me, pointerStyle, customImage, customMask, useCustom )
  29.   cursor( currentPointer )
  30. end
  31.  
  32. on restoreCursor me
  33.   set currentPointer = translate_cursor( me, RpointerStyle, RcustomImage, RcustomMask, useCustomR  )
  34.   cursor( currentPointer )
  35. end
  36.  
  37. on translate_cursor me, setting, image, mask, custom
  38.   if custom then
  39.     set val = [ member image, member mask ]
  40.     return val
  41.   end if
  42.   return setting
  43. end
  44.  
  45.  
  46.  
  47. ---
  48.  
  49. on getPropertyDescriptionList
  50.   
  51.   set p_list = [ ¼
  52.   #changeBegin: [ #comment:    "Change Pointer on BeginSprite:", ¼
  53.                     #format:   #boolean, #default:false], ¼
  54.   #changeEnd: [ #comment:      "Restore Pointer on EndSprite:", ¼
  55.                     #format:   #boolean, #default:false], ¼
  56.   #pointerStyle: [ #comment:   "Pointer Image:", ¼
  57.                     #format:   #cursor, #default: 1], ¼
  58.   #useCustom: [ #comment:      "Use Custom Pointer Image:", ¼
  59.                     #format:   #boolean, #default:false], ¼
  60.   #customImage: [ #comment:    "Custom Image:", ¼
  61.                     #format:   #bitmap, ¼
  62.                    #default:    member 1 ], ¼
  63.     #customMask: [ #comment:   "Custom Mask:", ¼
  64.                     #format:   #bitmap, ¼
  65.                    #default:    member 1 ], ¼
  66.   #RpointerStyle: [ #comment:  "Restored Pointer Image:", ¼
  67.                     #format:   #cursor, #default:1], ¼
  68.   #useCustomR: [ #comment:     "Restore Custom Pointer Image:", ¼
  69.                     #format:   #boolean, #default:false], ¼
  70.   #RcustomImage: [ #comment:   "Restored Custom Image:", ¼
  71.                     #format:   #bitmap, ¼
  72.                    #default:    member 1 ], ¼
  73.     #RcustomMask: [ #comment:  "Restored Custom Mask:", ¼
  74.                     #format:   #bitmap, ¼
  75.                    #default:    member 1 ] ¼
  76.   ]
  77.   return p_list  
  78. end
  79.  
  80. on getBehaviorDescription
  81.   return ¼
  82. "Changes the pointer image to one of the pointers included with Director, or to a  1-bit bitmapped castmember. Attach the behavior to a sprite or place it in the script channel." & RETURN & ¼
  83. "PARAMETERS:" & RETURN & ¼
  84. "ò Change on BeginSprite - Turn this option on to change the pointer in the frame where the sprite begins."  & RETURN & ¼
  85. "ò Change on EndSprite - Turn this option on to restore the pointer in the frame after the sprite ends."  & RETURN & ¼
  86. "ò Pointer - Choose one of Director's included pointers."  & RETURN & ¼
  87. "ò Use Custom - Turn this option on to use a cast member for a pointer instead of one of Director's included pointers."  & RETURN & ¼
  88. "ò Custom Image  - ( optional ) Choose which cast member to use as a pointer image. This setting is ignored if Use Custom isn't on."  & RETURN & ¼
  89. "ò Custom Mask - ( optional ) Choose a cast member to use as a mask image." & RETURN & ¼
  90. "ò Restored Pointer - Choose one of Director's included pointers to be displayed when the sprite ends."  & RETURN & ¼
  91. "ò Restore Custom - Turn this option on to display a cast member when the sprite ends."  & RETURN & ¼
  92. "ò Restored Custom Image  - ( optional ) Choose a cast member to display as the pointer image when the sprite ends."  & RETURN & ¼
  93. "ò Restored Custom Mask - ( optional ) Choose a cast member to use as a mask image when the sprite ends.  " & RETURN & ¼
  94. "MESSAGES:" & RETURN & ¼
  95. "ò ChangeCursor - Changes the pointer to the specified image."  & RETURN & ¼
  96. "ò RestoreCursor - Restores the original pointer image."
  97.   
  98. end
  99.